sugarfreeApp.factory('HttpService',['$http','$q',function($http,$q) {
  var service = {
		  get:get,
		  post:post,
		  postJson:postJson
  };
  return service;
  
  function get(url,data){
	  //var deferred  = $q.defer();
	  return $http.get(url);
  }
  
  function post(url,data){
	  return $http({
		method: 'POST',
		url: url,
		data: data,
		headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}
	  });
  }
  
  function postJson(url,data){
  	return $http.post(url,data);
  }
}]);